#include <stdio.h>

int main(int argc, char *argv[])
{
    FILE *fp;

    fp = fopen("abc.txt", "r+");

    char buf[100] = "I am buffer.\n";

    fprintf(fp, "buf = %s", buf);

    if (fclose(fp) == EOF) {
        perror("fclose");
        return EOF;
    }

    return 0;
}
